import { reactive, defineComponent, PropType } from "vue";
import Icon from "../icon";
import { createNamespace } from "../utils";
const [name, bem] = createNamespace("calendar");
export default defineComponent({
  emits: ["back"],
  setup(props, { slots, emit }) {
    const state = reactive({
      weekdays: ["日", "一", "二", "三", "四", "五", "六"],
    });

    const handlerClick = () => {
      emit("back");
    };

    return () => {
      return (
        <div class={bem("header")}>
          <div class={bem("title")}>
            <div class={bem("title-left")} onClick={handlerClick}>
              <Icon name="left" />
            </div>
            日期选择
          </div>
          <div class={bem("weekdays")}>
            {state.weekdays.map((item, index) => (
              <div key={index} class={bem("weekday")}>
                {item}
              </div>
            ))}
          </div>
        </div>
      );
    };
  },
});
